{% extends "bootstrap/base.html" %}

{% block head %}
    {{ super() }}
    <link rel="stylesheet" href="{{ url_for('static', filename='css/base.css') }}">
{% endblock %}

{% block title %}极光宝盒{% endblock %}

{% block navbar %}
    <div class="header">
        <nav class="navbar" role="navigation">
            <div class="container-fluid">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" id="navbar-collapse-btn"
                            data-toggle="collapse" data-target="#navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar jbox-bar"></span>
                        <span class="icon-bar jbox-bar"></span>
                        <span class="icon-bar jbox-bar"></span>
                    </button>
                    <a href="{{ url_for('main.index') }}"><img id="logo" src="/static/images/JBoxicon.png"></a>
                </div>
                <div class="collapse navbar-collapse" id="navbar-collapse">
                    <ul class="nav navbar-nav pull-right">
                        <li><a class="jbox-font nav-font" href="{{ url_for('main.document') }}">API 文档</a></li>
                        <li><a class="jbox-font nav-font" href="{{ url_for('main.guide') }}">指南</a></li>
                        {% if 'qq_token' in session %}
                            <li class="navigator-item"><a class="jbox-font nav-font"
                                                          href="{{ url_for('auth.manage') }}">控制台</a></li>
                            <li><a class="jbox-font nav-font" href="{{ url_for('auth.send_message') }}">发消息</a></li>
                        {% endif %}
                        <li id="nav-divider-li">
                            <div id="nav-divider"></div>
                        </li>
                        {% if 'qq_token' in session %}
                            {% if developer %}
                                {% if  developer.avatar %}
                                    <li id="nav-avatar-li"><img id="avatar" src="/static/user/images/{{ developer.avatar }}">
                                    </li>
                                {% else %}
                                    <li id="nav-avatar-li"><img id="avatar" src="/static/images/DefaultHead.png"></li>
                                {% endif %}
                                <li>
                                    <a class="jbox-font nav-font" href="{{ url_for('auth.profile') }}">
                                        {{ developer.username }}
                                    </a>
                                </li>
                                <li><a class="jbox-font nav-font" href="{{ url_for('main.logout') }}">登出</a></li>
                            {% else %}
                                <li id="nav-avatar-li"><img id="avatar" src="/static/images/bear.png"></li>
                                <li><a class="jbox-font nav-font"
                                       href="{{ url_for('auth.profile') }}">Devname</a>
                                </li>
                                <li><a class="jbox-font nav-font" href="{{ url_for('main.logout') }}">登出</a></li>
                            {% endif %}
                        {% else %}
                            <li><a class="jbox-font nav-font" href="{{ url_for('main.login') }}">登录</a></li>
                        {% endif %}
                    </ul>
                </div>
            </div>
        </nav>
    </div>
    <script type="text/javascript">

        $(window).resize(function () {
            if ($(window).width() < 768) {
                $('#nav-divider-li').hide();
                $('#nav-avatar-li').hide();
            } else {
                $('#nav-divider-li').show();
                $('#nav-avatar-li').show();
            }
        });
    </script>
{% endblock %}

{% block footer %}
    <div class="row" style="text-align: center;">
        <footer>
            <div role="contentinfo">
                <!-- Copyright etc -->
                <p>Copyright 2011-2016, jiguang.cn, All Rights Reserved. <br/>粤ICP备12056275号-13 深圳市和讯华谷信息技术有限公司</p>
            </div>
            <div style="text-align: center">Built with <a href="http://www.mkdocs.org">MkDocs</a>
            </div>
        </footer>
    </div>
{% endblock %}